<template>
	<view>
		<view class="bg"></view>
		<view class="container">
			<view class="info panel">
				<view class="info-line">
					<text>负责人:</text>
					<view class="input">
						<input type="text" placeholder="输入负责人姓名" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>身份证号码:</text>
					<view class="input">
						<input type="text" placeholder="输入负责人身份证号码"
							placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>手机号:</text>
					<view class="input">
						<input type="text" placeholder="输入手机号" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>验证码:</text>
					<view class="input verification">
						<input type="text" placeholder="输入验证码" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
						<text @click="getCode()">{{getCodeText}}</text>
					</view>
				</view>
				<view class="info-line">
					<text>店名:</text>
					<view class="input">
						<input type="text" placeholder="输入店名" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>工商营业执照号码:</text>
					<view class="input">
						<input type="text" placeholder="输入工商营业执照号码"
							placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>经营区域:</text>
					<view class="input">
						<input type="text" placeholder="输入经营区域" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
				<view class="info-line">
					<text>地址:</text>
					<view class="input">
						<input type="text" placeholder="输入地址" placeholder-style="color: #c7c9ce; font-size: 16rpx" />
					</view>
				</view>
			</view>
			<view class="introduction panel">
				<view class="title">商家简介</view>
				<textarea name="" id="" cols="20" rows="10" placeholder="请准确介绍一下公司的情况"></textarea>
			</view>
			<view class="identification panel">
				<view class="title">身份证正反面照片</view>
			</view>
			<view class="license panel">
				<view class="title">营业执照</view>
			</view>
			<view class="photo panel">
				<view class="title">门店照片</view>
			</view>
			<button class="btn">注册</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getCodeText: '获取验证码',
				getCodeIsWaiting: false,

			}
		},
		methods: {
			Timer() {},
			getCode() {
				if (this.getCodeIsWaiting) {
					return
				}
				this.setTimer()
			},
			setTimer() {
				this.getCodeIsWaiting = true
				let holdTime = 60;
				this.getCodeText = '重新获取(60)';
				this.Timer = setInterval(() => {
					if (holdTime <= 0) {
						this.getCodeText = '获取验证码';
						this.getCodeIsWaiting = false;
						clearInterval(this.Timer);
						return;
					}
					this.getCodeText = '重新获取(' + holdTime-- + ')';
				}, 1000)
			}
		}
	}
</script>

<style>
	.bg {
		height: 400rpx;
		background-color: #3486FD;
	}

	.container {
		position: absolute;
		top: 30rpx;
	}
	
	.panel {
		width: 650rpx;
		margin: 0 30rpx 0 30rpx;
		border-radius: 30rpx;
		padding: 50rpx 20rpx 30rpx 20rpx;
		background-color: #FFFFFF;
		margin-bottom: 30rpx;
	}

	.info-line {
		display: flex;
		align-items: center;
		margin-bottom: 30rpx;
	}

	.info-line>text {
		width: 250rpx;
		font-weight: bold;
	}

	.info-line .input {
		border: 1rpx solid #e9e9eb;
		padding: 15rpx;
		border-radius: 50rpx;
		width: 380rpx;
	}

	.info-line .input>input {
		font-size: 26rpx;
	}

	.verification>input {
		width: 150rpx;
		border-right: 1rpx solid #8f939c;
	}

	.verification {
		display: flex;
		align-items: center;
		font-size: 26rpx;
	}

	.verification>text {
		color: #90B6F6;
		margin-left: 30rpx;
	}
	
	.introduction>textarea {
		margin-top: 20rpx;
		padding: 20rpx;
		border: 1rpx solid #8f939c;
		border-radius: 30rpx;
		font-size: 28rpx;
	}

	.panel .title{
		font-weight: bold;
		font-size: 30rpx;
	}
	
	.btn {
		background-color: #0863E7;
		width: 600rpx;
		color: #FFFFFF;
		border-radius: 50rpx;
		margin-bottom: 30rpx;
	}
</style>